﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using System.Web.Security;

namespace Tebbee.Business.Server
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "StatisticSer" in code, svc and config file together.
    // NOTE: In order to launch WCF Test Client for testing this service, please select StatisticSer.svc or StatisticSer.svc.cs at the Solution Explorer and start debugging.
    public class StatisticSer : IStatisticSer
    {
        private readonly TebbeeContext context;

        public StatisticSer()
        {
            context = new TebbeeContext();
        }

        public ICollection<User_Newsest_Result> Statistic_NewestUser()
        {
            return context.User_Newsest().ToList();
        }


        public Statistic_HitsAds_Result Statistic_HitsAds()
        {
            return context.Statistic_HitsAds().Single();
        }

        public Statistic_ViewLikeRate_Result Statistic_ViewLikeRate()
        {
            return context.Statistic_ViewLikeRate().Single();
        }


        public ICollection<User_Statistic_Result> Statistic_User(int year)
        {
            return context.User_Statistic(year).ToList();
        }


        public ICollection<Statistic_likeViewHits_Result> Statistic_LikeViewHits(int year)
        {
            return context.Statistic_likeViewHits(year).ToList();
        }


        public ICollection<Statistic_Details_Result> Statistic_Details(DateTime from, DateTime to)
        {
            return context.Statistic_Details(from, to).ToList();
        }

        public Statistic_CountAdsHitUser_Result Statistic_CountAdsHitUser()
        {
            return context.Statistic_CountAdsHitUser().Single();
        }


        public ICollection<string> Email_GetForBroadcast()
        {
            return context.Email_GetForBroadcast().ToList();
        }
    }
}
